--消息回复
return function(group,qq,msg)

    -- 红包抽奖
    if msg:find("%[CQ:hb") then
        apiXmlInsert("","Luck",os.date("%Y-%m-%d",os.time()),tostring(qq))
        sendMessage("成功参与红包抽奖！")
        return true
    end

    -- 百分百回复
    local oCommon = apiXmlGet("","ocommon",msg)
    if oCommon ~= "" then
        sendMessage(oCommon)
        return true
    end

    --判断是否设置机器人唤醒词 和回复概率
    if name ~= "" then
        if msg:find(name)==1 then
            msg = msg:gsub(name,""):trim()
            if msg == "" then
                sendMessage("我在呢")
                return true
            end
        else
            if probability ~= "" then
                if math.random(1,10) > tonumber(probability)   then
                    return true 
                end
            else
                return true
            end
        end
    elseif probability ~= "" then
        if math.random(1,10) > tonumber(probability)   then
            return true
        end
    end

    -- 通用回复
    if not msg:find("%[CQ:") then
            
        -- 感兴趣标签推送
        local label = apiXmlReplayGet("class","label",msg)
        if label ~= "" then
            local message = apiHttpGet("https://0nly.cn/cq",'l_'..tostring(group)..'.'..label)
            sendMessage(message)
            return true
        end

        -- 回复
        local replyGroup = apiXmlReplayGet(tostring(group),"common",msg)
        local replyCommon = apiXmlReplayGet("","common",msg)
        local replyrecord = apiXmlReplayGet("record\\"..mettle,"replayrecord",msg)
        local userecord = apiXmlReplayGet("record","userecord",msg)
        if apiXmlGet("","norecord",tostring(group))=="f" then
            replyrecord = ""
            userecord = ""
        end
        --文字回复
        if replyGroup == "" and replyCommon ~= "" then
            sendMessage(replyCommon)
            return true
        elseif replyGroup ~= "" and replyCommon == "" then
            sendMessage(replyGroup)
            return true
        elseif replyGroup ~= "" and replyCommon ~= "" then
            sendMessage(math.random(1,2)==1 and replyCommon or replyGroup)
            return true
        end
        --语音回复
        if userecord== "" and replyrecord ~= "" then
            sendMessage(cqCqCode_Record(mettle.."\\"..replyrecord))
            return true
        elseif userecord~= "" and replyrecord == ""then
            sendMessage(cqCqCode_Record(userecord))
            return true
        elseif userecord~= "" and replyrecord ~= ""then
            sendMessage(math.random(1,2)==1 and cqCqCode_Record(userecord) or cqCqCode_Record(mettle.."\\"..replyrecord))
            return true
        end
        --图片回复
        if apiXmlGet("","noimage",tostring(group))~="f" and string.len(msg) < 31 then
            apiHttpImagesDownload("https://www.doutula.com/search?keyword="..msg:gsub("\r\n",""),"image\\user\\"..msg:gsub("\r\n",""))
            if cqSendGroupMessage(group,cqCqCode_Image(msg:gsub("\r\n","").."\\"..math.random(1,10)..".jpg")) == -11 then
                sendMessage(cqCqCode_Image("user\\"..msg:gsub("\r\n","").."\\1.jpg") )
            end
            return true
        end
        return true
    end
end